package qx.hyj.demos.mapper;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import qx.hyj.demos.entity.Ubjl;
import qx.hyj.demos.entity.User;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface Usermapper {
    @Insert("insert into user (name,type) values (#{name},#{type})")
    Integer addUser(User user);

    @Select("select * from user where `userId` = #{id}")
    User getUser(int id);

    @Select("select * from user where name = #{userName}")
    User getIdByName(String userName);

    @Update("update user set bookSize = #{bookSize} where userId = #{id}")
    Integer updateBookSize(@Param("id") Integer id, @Param("bookSize") Integer bookSize);


}
